import http from '@/http/index';
import type { Result } from '@/http/type';
import type { DeviceColumnSpecifications, DeviceColumnSpecificationsQuery } from './type';

const api = {
  list: '/api/device-column-specifications/page',
  detail: '/api/device-column-specifications',
  add: '/api/device-column-specifications',
  update: '/api/device-column-specifications',
  delete: '/api/device-column-specifications',
};

/**
 * 分页查询立柱规格
 * @param params 查询参数
 */
export function getDeviceColumnSpecificationsList(params: DeviceColumnSpecificationsQuery) {
  return http.get<Result<any>>(api.list, params);
}

/**
 * 获取立柱规格详情
 * @param id 立柱规格ID
 */
export function getDeviceColumnSpecificationsDetail(id: number | string) {
  return http.get<Result<DeviceColumnSpecifications>>(`${api.detail}/${id}`);
}

/**
 * 新增立柱规格
 * @param data 立柱规格数据
 */
export function addDeviceColumnSpecifications(data: DeviceColumnSpecifications) {
  return http.post<Result<boolean>>(api.add, data);
}

/**
 * 更新立柱规格
 * @param data 立柱规格数据
 */
export function updateDeviceColumnSpecifications(data: DeviceColumnSpecifications) {
  return http.put<Result<boolean>>(api.update, data);
}

/**
 * 删除立柱规格
 * @param id 立柱规格ID
 */
export function deleteDeviceColumnSpecifications(id: number | string) {
  return http.delete<Result<boolean>>(`${api.delete}/${id}`);
} 